package view;

import java.awt.Component;
import java.awt.Container;
import java.awt.GridLayout;

import javax.swing.JFrame;

import view.drawable.DrawableView;
import view.table.circle.CircleView;
import view.table.square.SquareView;
import controller.Controller;

public class WrapperFrame extends JFrame {
	
	private static final long serialVersionUID = -5328804533520895158L;

	public WrapperFrame(Controller controller) {
		JFrame frame = new JFrame("DPO - mvc");
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		Container holder = new Container();
		holder.setLayout(new GridLayout());
		holder.add(createDrawableView(controller));
		holder.add(createCircleView(controller));
		holder.add(createSquareView(controller));
		frame.setContentPane(holder);
		frame.setVisible(true);
		frame.setSize(1000, 400);
	}

	private Component createSquareView(Controller controller) {
		SquareView squareView = new SquareView(controller);
		return squareView.getSwingView();
	}

	private Component createCircleView(final Controller controller) {
		CircleView circleView = new CircleView(controller);
		return circleView.getSwingView();
	}

	private Component createDrawableView(Controller controller){
			return new DrawableView(controller);
	}
	
}
